package com.microservice.salmon.oauth.code;

import org.springframework.web.context.request.ServletWebRequest;

public interface ValidateCodeRepository {

    /**
     * 保存验证码
     * @param request ServletWebRequest
     * @param validateCode ValidateCode
     * @param validateCodeType ValidateCodeType
     */
    void save(ServletWebRequest request, ValidateCode validateCode, ValidateCodeType validateCodeType);

    /**
     * 获取验证码
     * @param request ServletWebRequest
     * @param validateCodeType ValidateCodeType
     * @return
     */
    ValidateCode get(ServletWebRequest request, ValidateCodeType validateCodeType);

    /**
     * 删除验证码
     * @param request ServletWebRequest
     * @param validateCodeType ValidateCodeType
     */
    void remove(ServletWebRequest request, ValidateCodeType validateCodeType);
}
